import axios from '@/libs/api.request'



export  const getUserList = (data) => {
  return axios.request({
    url: '/wh-portal/api/user/list',
    data,
    method: 'post'
  })
};


export  const  getDeptTree = ()=>{
   return  axios.request({
     url: '/wh-portal/api/dept/deptList',
     method: 'post'
   });
}

export  const  freezeUser = (data)=>{
  return axios.request({
    url: '/wh-portal/api/user/freeze',
    data,
    method: 'post'
  })
}
export  const  userAdd = (data)=>{
  return  axios.request({
    url: '/wh-portal/api/user/add',
    data,
    method: 'post'
  })
}

export  const  userEdit = (data)=>{
  return axios.request({
    url: '/wh-portal/api/user/edit',
    data,
    method: 'post'
  })
}

export  const getUserInfo = (data)=>{
  return axios.request({
    url: '/wh-portal/api/user/getUserInfo',
    data,
    method: 'post'
  })
}


export const  getUserRoleTree = (data) =>{
  return axios.request({
    url: '/wh-portal/api/role/getRoleTreeListByUserId',
    data,
    method: 'post'
  })
}

export const   setUserRoles = (data)=>{
  return axios.request({
    url: '/wh-portal/api/user/setRole',
    data,
    method: 'post'
  })
}

export const  resetPassword = (data)=>{
  return axios.request({
    url: '/wh-portal/api/user/reset',
    data,
    method: 'post'
  })
}
